reformat document