uniformly call only one version of all_match