Renamed write_* functions to one overload write function.