Refactor to DRY up and use  in increment_page_count