Refactoring Entity class