             }?.first
     }
     
-    private static func prepare(inout pattern: String, inout dynamicSegments: [String]) {
-        let options: NSStringCompareOptions = [.RegularExpressionSearch, .CaseInsensitiveSearch]
-        while let range = pattern.rangeOfString(":[a-zA-Z0-9-_]+", options: options) {
-            let segment = pattern
-                .substringWithRange(range.startIndex.advancedBy(1)..<range.endIndex)
-            dynamicSegments.append(segment)
-            pattern.replaceRange(range, with: "([^/]+)")
-        }
-    }
-    
 }

        }
        
        if dynamicSegments.count > 0 && dynamicSegments.count == matches.numberOfRanges - 1 {
            [Int](1 ..< matches.numberOfRanges).forEach { (index) in
                parameters[dynamicSegments[index-1]] = (route as NSString).substringWithRange(matches.rangeAtIndex(index))
            }
        }
        

    internal init(_ pattern: String, queue: dispatch_queue_t, handler: HandlerType) {
        var pattern = pattern
        var dynamicSegments = [String]()
        let options: NSStringCompareOptions = [.RegularExpressionSearch, .CaseInsensitiveSearch]
        while let range = pattern.rangeOfString(":[a-zA-Z0-9-_]+", options: options) {
            let segment = pattern
                .substringWithRange(range.startIndex.advancedBy(1)..<range.endIndex)
            dynamicSegments.append(segment)
            pattern.replaceRange(range, with: "([^/]+)")
        }
        
        self.pattern = pattern
        self.queue = queue
        self.handler = handler
        if case .Proxy(_) = handler {
            isProxy = true
        } else {
            isProxy = false
        }
        self.dynamicSegments = dynamicSegments
    }
    
