Improve import_class function