Replace the combination of new Variable and cfg_->addVariable() with cfg_->createVariable()