added class factory to basic library