Prettify and tidy up souce code