refactor the pager.php