Refactoring the model