Refactoring of rules to encapsulate in revealing module pattern