Can we extract the `relevant_rules_for_match` block into a single method so its not duplicated.