refactoring models