improve getAppPackages