Refactor the import task