refactoring entity groups