Slight refactoring of importer code.