made generic pattern matching rule