Tidy up code, fix some formatting