Finished refactoring of C++ code