model refactoring