code clean up for Entities