Re-implement the paginate_all as a writer function