model refactor