Refactoring of entities