give priority to more specific patterns