storm-76 optimized getRules by combining into single function, need to review whether dirty has entry match at top of foreach or at the bottom