Refactor RuleGrid