Cosmetic improvements in the entity factory.