Made method name write_file more consistent