Moved out print_output and read_file from the class.