Let's have PkgInstaller class having only two public methods: Install() an Uninstall(), this class will encapsulate all the dedicated code (the free functions InstallApplication() and UninstallApplication() should be removed).
The PkgInstaller should be created once in main() function of pkg_helper.