Refactor paginated fetching

[#65037890]