Refactoring to create reusable rules