Added better pagination support