code cleanup, on_page_view is deprecated in 5.7