Refactor invokeRules to validateRules