Moved entity type and id into the entity struct