cleaning c++ code