Removed redundant getEntity code and replaced
Cleanup