         
         let path = "/" + (components.host ?? "") + (components.path ?? "")
         
-        let queryItems = components.queryItems?
-            .reduce(Parameters()) { (var dict, item) in dict.updateValue((item.value ?? ""), forKey: item.name); return dict }
-            ?? [:]
+        var queryItems: [String: String] = [:]
+        components.queryItems?.forEach() {
+            queryItems.updateValue(($0.value ?? ""), forKey: $0.name)
+        }
         
         let proxy = self.routes
             .map { closure -> (ProxyHandler?, Parameters) in

import Foundation

public class Routing {
    public typealias Parameters = [String : String]
    public typealias Completed = () -> Void
    
    public typealias ProxyHandler = (String, Parameters) -> (String, Parameters)
    public typealias RouteHandler = (Parameters, Completed) -> Void
    
    enum RouteType {
        case Proxy((String) -> (ProxyHandler?, Parameters))
        case Route((String) -> (RouteHandler?, Parameters))
    }

        let route = self.routes
            .map { closure -> (RouteHandler?, Parameters) in
                if case let .Route(f) = closure { return f(proxy?.0 ?? path) }
                else { return (nil, [String: String]())}
            }
            .filter { $0.0 != nil }
            .first
