refactoring Model