Use type() to create new classes and a factory to instantiate.