refactoring entities