matchUntil was changed for performance