     }
 
     public func getTarget(_ targetName: String) -> Target? {
-        return targets.first { $0.name == targetName }
+        return targetsMap[targetName]
     }
 
     public func getConfig(_ configName: String) -> Config? {

    public var fileGroups: [String]
    public var configFiles: [String: String]
    public var include: [String] = []

    public init(
        basePath: Path,

        } else {
            options = SpecOptions()
        }
        self.targetsMap = Dictionary(uniqueKeysWithValues: self.targets.map { ($0.name, $0) })
    }

    static func filterJSON(jsonDictionary: JSONDictionary) throws -> JSONDictionary {
