cleaned up pagination