Implementing auto-pagination and adding expansion support.