Modified the rule_cache method to be a bit more friendly.