refactoring model to separate class