redirecting code to all C++ implementation and cleaning up