Refactor import_csv method