Can we reduce this conditional down to a ternary?