I think these two lines should be an `elsif` or perhaps a `case` statement to avoid extra checks.