Refactored rules into RuleSets.