Small tidy-up of code