Refactors nextPageMatch (nits)