Added hierarchy structure to entity classes