Recursively modify grouped where phrases