Introduced extendModel method which extends the model with the constraints. Cached declaration and constraints in extendModel