Bit of a nit, but since you end up using this expression in both branches, pull it up before the `if`?