refactoring of entity class