Minor refactor to make code more idiomatic Ruby

Rules applied from the [GitHub Ruby styleguide](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."

Since this isn't related to a new feature, feel free to reject this pull request ;)