restructure print_to_string-family