This looks nice, but good god is it just ternary for the sake of ternary.  Explicit if-else branches please!