Refactoring entities