moved entity methods into class