refactoring entity method