Remove duplicate definition of write_file