bit of code tidy