Renamed func.
Declare local var once.
Improved package_manager func.