At this point, it doesn't make sense to make it more generic. The issue is that problems have 2 types ("simple/common" and "advanced"). The template to render the menu has to handle tabs in this case. Right now all the code on the server side as well is special-cased for problems.

If we ever have another case where the menu has to handle multiple groups, we could generalize the code at that time. I don't think it is worth the complexity and time to do it now, when there is a very good chance we will never need it.