Made a matching rule more generic