Minor tidy of code