Improve Code Climate score

Avoid multi-line ?: (the ternary operator); use `if`/`unless` instead.