refactoring of ruleset