net: Clean up the C++ code.