Made EntityFactory mergeable
Made PortalFactory merging more future-proof