refactoring in app entyties