         
         // Now we inject the environment into the path.
         let fileExtension = defaultUrlPath.pathExtension
-        var envSpecificFilePath = defaultUrlPath.deletingPathExtension()
-        envSpecificFilePath = envSpecificFilePath.appendingPathExtension(env)
-        envSpecificFilePath = envSpecificFilePath.appendingPathExtension(fileExtension)
+        let envSpecificFilePath = defaultUrlPath.deletingPathExtension().appendingPathExtension(env).appendingPathExtension(fileExtension)
 
         // Insert at index 1 because the private config file overrides
         paths.insert(envSpecificFilePath, at: 1)



public extension ConfigManager {
    public subscript(key: ConfigManagerKey<Any?>) -> Any? {
        get { return self[key.keyPath] ?? key.defaultValue }
    }
    
    public subscript(key: ConfigManagerKey<String?>) -> String? {
        get { return self[key.keyPath] as? String ?? key.defaultValue }
    }
    
    public subscript(key: ConfigManagerKey<URL?>) -> URL? {

            return URL(string: rawValue)
        }
    }

    public subscript(key: ConfigManagerKey<URL>) -> URL {
        get {
            guard let rawValue = self[key.keyPath] as? String else {
                return key.defaultValue
            }

            return URL(string: rawValue)!
        }
    }
}
