replaced stringstreams for simple conversions