                 DispatchQueue.main.async {
                     childProgress.completedUnitCount += 1
                 }
-            })
+            }
             
             guard !self.isCancelled else { return [:] }
             
             // extract simple words
-            if !simpleWordsDict.isEmpty || !simpleICWordsDict.isEmpty {
-                let extractedRanges = self.ranges(simpleWords: simpleWordsDict,
-                                                  ignoreCaseWords: simpleICWordsDict,
-                                                  charSet: self.simpleWordsCharacterSets![syntaxType]!)
-                ranges.append(contentsOf: extractedRanges)
+            if let charSet = self.simpleWordsCharacterSets?[syntaxType], !charSet.isEmpty {
+                ranges += self.ranges(simpleWords: simpleWords,
+                                      ignoreCaseWords: simpleICWords,
+                                      charSet: charSet)
             }
             
             // store range array

    // MARK: Private Methods
    
    /// extract ranges of passed-in words with Scanner by considering non-word characters around words
    private func ranges(simpleWords wordsDict: [Int: [String]], ignoreCaseWords: [Int: [String]], charSet: CharacterSet) -> [NSRange] {
        
        var ranges = [NSRange]()
        

            
            let childProgress = Progress(totalUnitCount: definitions.count + 10)  // + 10 for simple words
            
            var simpleWords = [String]()
            var simpleICWords = [String]()
            let wordsQueue = DispatchQueue(label: "com.coteditor.CotEdiotor.syntax.words." + syntaxType.rawValue)
            
            var ranges = [NSRange]()
            let rangesQueue = DispatchQueue(label: "com.coteditor.CotEdiotor.syntax.ranges." + syntaxType.rawValue)
            
            DispatchQueue.concurrentPerform(iterations: definitions.count) { (i: Int) in
                guard !self.isCancelled else { return }
                
                let definition = definitions[i]
