FIX: refactored `bundleUpdated` to break down the promise handlers as function factories for better testability.