minor refactor to make code more idiomatic Ruby

Rules applied from https://github.com/styleguide/ruby:
- "Avoid `return` where not required."
- "The `and` and `or` keywords are banned... Always use && and || instead."
- "Avoid explicit use of `self` as the recipient of internal class or
  instance messages unless to specify a method shadowed by a variable."
Merge branch 'pull-request-43'