Simplified version of the converter, thanks to sstream