clean up temporary string building, use stackstring instead of std::string