Could you maybe go if ("storyAttr") else if ("prio") else () instead?

To get rid of the big if else.