added class factory to terrain library