refactoring of entities