probably do this immed following the getOwner so all the write_flat_files are together