Cleanup in cxx code