Rewrite legacy code to C++ for vconf handler