refactoring functional ManageRulesTest