Simplify code by using std::to_string