refactoring model