Entity refactoring