Refactor to DRY up and use  in increment_page_count

Tests are still failing, but the expected behavior is correct on the server. #4