Simplify package_exists() function