slight refactor of pager::query