             var fetchedPlaces = [Deferred<DatabaseResult<Place>>]()
             self.placesLock.withReadLock {
                 for placeKey in Array(placeKeyToLoc.keys) {
-                    if let index = (self.places.index { (place) -> Bool in
-                        place.id == placeKey
-                    }) {
-                        let place = self.places[index]
+                    if let index = self.placeKeyMap[placeKey] {
+                        let place = self.displayedPlaces[index]
                         fetchedPlaces.append(Deferred(filledWith: DatabaseResult.succeed(value: place)))
                     } else {
                         unfetchedPlaces.append(placeKey)


    convenience init(places: [Place]) {
        self.init()
        self.places = places
    }

    func place(forKey key: String, callback: @escaping (Place?) -> ()) {

    func nextPlace(forPlace place: Place) -> Place? {
        return self.placesLock.withReadLock {
            // if the place isn't in the list, make the first item in the list the next item
            guard let currentPlaceIndex = self.placeKeyMap[place.id] else {
                return displayedPlaces.count > 0 ? displayedPlaces[displayedPlaces.startIndex] : nil
            }

            guard currentPlaceIndex + 1 < displayedPlaces.endIndex else { return nil }

            return displayedPlaces[displayedPlaces.index(after: currentPlaceIndex)]
        }
    }

    func previousPlace(forPlace place: Place) -> Place? {
        return self.placesLock.withReadLock {
            guard let currentPlaceIndex = self.placeKeyMap[place.id],
                currentPlaceIndex > displayedPlaces.startIndex else { return nil }

            return displayedPlaces[displayedPlaces.index(before: currentPlaceIndex)]
        }
    }

    func numberOfPlaces() -> Int {
        return self.placesLock.withReadLock {
            return displayedPlaces.count
        }
    }

    func place(forIndex index: Int) throws -> Place {
        return try self.placesLock.withReadLock {
            guard index < displayedPlaces.endIndex,
                index >= displayedPlaces.startIndex else {
                    throw PlaceDataSourceError(message: "There is no place at index: \(index)")
            }

            return displayedPlaces[index]
        }
    }

    func index(forPlace place: Place) -> Int? {
        return self.placesLock.withReadLock {
            return placeKeyMap[place.id]
        }
    }

    func fetchPlace(placeKey: String, withEvent eventKey: String, callback: @escaping (Place?) -> ()) {
        self.placesLock.withReadLock {
            if let placeIndex = placeKeyMap[placeKey] {
                let place = displayedPlaces[placeIndex]
                if place.events.contains(where: { $0.id == eventKey }) {
                    callback(place)
                }
