Refactor pager