Tidy up comments and formatting