(#3262) - Minor style fixes

Inlined some unnecessary function calls, extraced some re-used logic,
indented a few things.
I think it's usually clearer when the ternary does

```js
bool ? thing1 : thing2
```

rather than

```js
!bool ? thing2 : thing1
```