       defer { self?.crawl() }
       guard
         let data = data,
-        let document = String(data: data, encoding: .utf8) else { return }
-      self?.parse(document: document, url: url)
+        let webpage = String(data: data, encoding: .utf8) else { return }
+      self?.parse(webpage, url: url)
     }
 
     delegate?.crawler(self, willVisitUrl: url)

      return anchors.compactMap({ try? $0.absUrl("href") }).compactMap(URL.init(string:))
    }

    find(word: wordToSearch, from: document)
    collectLinks(from: document).forEach { pagesToVisit.insert($0) }
  }
}

  /// Parses the given document.
  ///
  /// - Parameters:
  ///   - webpage: The content to parse.
  ///   - url: The url associated with the document.
  func parse(_ webpage: String, url: URL) {
    func find(word: String, from document: String) {
      guard document.contains(word) else { return }
      delegate?.crawler(self, didFindWordAt: url)
