some refactoring of index_pager code