clean up and create pagination class