refactor to decompose rule set utility