     }
 
     func outlineView(_ outlineView: NSOutlineView, child index: Int, ofItem item: Any?) -> Any {
-        if item == nil {
-            return cities[index]
-        }
+        guard let item = item else { return cities[index] }
 
         switch item {
-        case is City:
-            let city = item as! City
+        case let city as City:
 
             if index == 0 && !city.day.videos.isEmpty {
                 return city.day

    func outlineView(_ outlineView: NSOutlineView,
                     objectValueFor tableColumn: NSTableColumn?, byItem item: Any?) -> Any? {
        switch item {
        case is City:
            let city = item as! City
            return city.name
        case is TimeOfDay:
            let timeOfDay = item as! TimeOfDay
            return timeOfDay.title

        default:
            return "untitled"
        }


    func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
        switch item {
        case let video as AerialVideo:
            player = AVPlayer()
            playerView.player = player

            debugLog("Playing this preview \(video)")
            // Workaround for cached videos generating online traffic
            if video.isAvailableOffline {
