   * Foundation's NSURLComponents class.
   */
   public func getServiceURL(spec: String, replacements: [String:AnyObject]?) -> String? {
-    var substitutions: [String:AnyObject] = (replacements == nil) ? [:] : replacements!
+    var substitutions: [String:AnyObject] = replacements ?? [:]
     let service = getService(spec);
-    let credentials = (service != nil) ? service!["credentials"] as? [String:AnyObject] : nil;
+    let credentials = service?["credentials"] as? [String:AnyObject]
     if (credentials == nil) {
         return nil;
     }
 
-    var url: String?
+    let url: String?
     if substitutions["url"] != nil {
       url = credentials![substitutions["url"] as! String] as? String
-    } else if credentials!["url"] != nil {
-      url = credentials!["url"] as? String
-    } else if credentials!["uri"] != nil {
-      url = credentials!["uri"] as? String
     } else {
-      url = nil
+      url = credentials!["url"] as? String ?? credentials!["uri"] as? String
     }
 
     if (url == nil) {

  */
  public func getService(spec: String) -> [String:AnyObject]? {
    let services = getServices()
    let service: [String:AnyObject]? = services[spec]
    if service != nil {
      return service
    }


    for (key, substitution) in substitutions {
      print("\(key) : \(substitution)")
      // TODO: Update parsedURL object accordingly
      // Probably using reflection (aka mirrors)...
    }
    return parsedURL!.string
  }

