slight simplification of read_file