I think this will benefit from splitting casedef+match into casedef+casedef