Tidy up some formatting and comments