ModelFactory refactoring