         init(coreProperties: CoreProperties,
              publicationState: LoadingState<PublicationId, PublicationModel>,
              pagesState: LoadingState<PublicationId, [PageModel]>,
-             hotspotsState: LoadingState<PublicationId, [HotspotModel]>) {
+             hotspotsState: LoadingState<PublicationId, [IndexSet: [HotspotModel]]>) {
             
             switch (publicationState, pagesState, hotspotsState) {
             case (.error(_, let error), _, _),

    }
    
    public func hotspotModels(onPageIndexes pageIndexSet: IndexSet) -> [HotspotModel] {
        guard case .loaded(_, let hotspotModels) = self.hotspotsState else {
            return []
        }
        return hotspotModels.filter({
            IndexSet($0.pageLocations.keys).contains(integersIn: pageIndexSet)
        })
    }
    

    private func hotspotsDidLoad(forId publicationId: PublicationId, initialPageIndex: Int?, result: Result<[HotspotModel]>) {
        switch result {
        case .success(let hotspotModels):
            // key hotspots by their pageLocations
            let hotspotsByPage: [IndexSet: [HotspotModel]] = hotspotModels.reduce(into: [:], {
                let pageKey = IndexSet($1.pageLocations.keys)
                $0[pageKey] = $0[pageKey, default: []] + [$1]
            })
            
            self.hotspotsState = .loaded(publicationId, hotspotsByPage)
            self.delegate?.didLoad(hotspots: hotspotModels, in: self)
        case .error(let error):
            self.hotspotsState = .error(publicationId, error)
