Slowly moving to C++ code