refactor out Pages from Pagination