Improved privacy checks and simplified the print_page function