move the pagination class and change the layout