Implemented remove_model_class, some refactoring.