refactor update_links to a new helper

use the new helper in the page and book converters