breaking down pagination into smaller chunks