move testing matching to apply_to