Refactor the existing importer function