Refactored BundleQueryImpl to enhance testability