improved magic exporter / importer