C++: code has been refactored.