Refactor import_* commands