More refinements, esp a best-practice way to determine pkg is/not installed