lots of import/export/format cleanup