Refactor to use same code for books and newspapers pages