refactoring to RulesTestController