Added switch for rules in design category + a bit of refactoring.