clean up and attempt to speed up parsing and export