 		
 	}
 	
-	func clearFolderRelationship(for feed: WebFeed, withFolderName folderName: String) {
+	func clearFolderRelationship(for feed: WebFeed, folderExternalID: String?) {
+		guard var folderRelationship = feed.folderRelationship, let folderExternalID = folderExternalID else { return }
+		folderRelationship[folderExternalID] = nil
+		feed.folderRelationship = folderRelationship
+	}
+	
+	func saveFolderRelationship(for feed: WebFeed, folderExternalID: String?, feedExternalID: String) {
+		guard let folderExternalID = folderExternalID else { return }
 		if var folderRelationship = feed.folderRelationship {
-			folderRelationship[folderName] = nil
-			feed.folderRelationship = folderRelationship
-		}
-	}
-	
-	func saveFolderRelationship(for feed: WebFeed, withFolderName folderName: String, id: String) {
-		if var folderRelationship = feed.folderRelationship {
-			folderRelationship[folderName] = id
+			folderRelationship[folderExternalID] = feedExternalID
 			feed.folderRelationship = folderRelationship
 		} else {
-			feed.folderRelationship = [folderName: id]
+			feed.folderRelationship = [folderExternalID: feedExternalID]
 		}
 	}
 

		}
	}
	
	func nameToFolderDictionary(with folders: Set<Folder>?) -> [String: Folder] {
		guard let folders = folders else {
			return [String: Folder]()
		}

		var d = [String: Folder]()
		for folder in folders {
			let name = folder.name ?? ""
			if d[name] == nil {
				d[name] = folder
			}
		}
		return d
	}


		
		for feed in account.topLevelWebFeeds {
			if !subFeedIds.contains(feed.webFeedID) {
				account.clearWebFeedMetadata(feed)
				account.removeWebFeed(feed)
			}
		}
