rewrite the import_as function