Use ensure_packages to avoid redeclaration