Refactoring in model