Added rule loading and categorization logic.