Interface of this function is ugly if it requires a stringstream with these settings