refactoring in the model