refactored the connection between rules, categories and matcher