Cleaning up ptb_page convert function