Reformat and tidy up