Replaced redundant getEntity code
Cleanup