Improve internal handling of EntityTypes