overhauled entity class and entitymanager