Add class factory.