DRYing the entity name parsing