Tidy up some code.