MODE-1953: Revert previous changes and pass pattern to iterator