Some minor tidy up to quickly written code