Minor tidy-up of code