You can remove this `if` and reduce it to a ternary