I suspect this would now be cleaner split in two/three with a function for Cpp and one for other.