Redesigned BundleUtils to be more general