     func tableViewSelectionDidChange(_ notification: Notification) {
         
         // update enability of "Delete Separator" button
-        self.deleteSeparatorButton?.isEnabled = {
-            for index in self.tableView!.selectedRowIndexes.sorted() {
-                let encoding = self.encodings[index].uint32Value
-                
-                if encoding == kCFStringEncodingInvalidId {
-                    return true
-                }
-            }
-            
-            return false
-        }()
+        self.deleteSeparatorButton?.isEnabled = self.tableView!.selectedRowIndexes.contains { index in
+            self.encodings[index].uint32Value == kCFStringEncodingInvalidId
+        }
     }
     
     

    private func deleteSeparators(at rowIndexes: IndexSet) {
        
        // pick only separators up
        var toDeleteIndexes = IndexSet()
        for index in rowIndexes.sorted() {
            let encoding = self.encodings[index].uint32Value
            
            if encoding == kCFStringEncodingInvalidId {
                toDeleteIndexes.insert(index)
            }
        }
        guard !toDeleteIndexes.isEmpty else { return }
        
        guard let tableView = self.tableView else { return }
        
        NSAnimationContext.runAnimationGroup({ context in
            // update UI
            tableView.removeRows(at: toDeleteIndexes, withAnimation: [.slideUp, .effectFade])
            }, completionHandler: { [weak self] in
                // update data
                self?.encodings.remove(in: toDeleteIndexes)
        })
    }
    

    
    func tableView(_ tableView: NSTableView, didAdd rowView: NSTableRowView, forRow row: Int) {
        
        guard let textField = (rowView.view(atColumn: 0) as? NSTableCellView)?.textField else { return }
        
        let cfEncoding = CFStringEncoding(self.encodings[row].uint32Value)
        
