Entity improvements
Refactoring