Could we rework this into `if elsif else` kind of thing? 3 nested ternary statements is perhaps a bit too many.