improve pagination class