entity generator refactoring