Introduced importer/exporter concept -- cleaned up the logic