Some minor refactorings

Here are a few very minor refactorings.

It'd be good to standardise stuff throughout the codebase a little. I'm happy to do this. Are you happy to use the [Ruby style guidelines](https://github.com/styleguide/ruby) as a guide?