move write_to_file to new location in runner