Some code improvements for importer.