refactor Model