implement entities and entitymanager