Change matching to take delegates