     }
 
     public init?(yaml: String) {
-        let yamlResult = Yaml.load(yaml)
-        guard let yamlConfig = yamlResult.value else {
-            if let error = yamlResult.error {
-                queuedPrint(error)
-            }
+        guard let yamlConfig = Configuration.loadYaml(yaml) else {
             return nil
         }
+        self.init(yamlConfig: yamlConfig)
+    }
+
+    private init?(yamlConfig: Yaml) {
         self.init(
             disabledRules: yamlConfig["disabled_rules"].arrayOfStrings ?? [],
             included: yamlConfig["included"].arrayOfStrings ?? [],

        )
    }

    public init(path: String = ".swiftlint.yml", optional: Bool = true) {
        let fullPath = (path as NSString).absolutePathRepresentation()
        let failIfRequired = {
            if !optional { fatalError("Could not read configuration file at path '\(fullPath)'") }

        do {
            let yamlContents = try NSString(contentsOfFile: fullPath,
                encoding: NSUTF8StringEncoding) as String
            if let yamlConfig = Configuration.loadYaml(yamlContents) {
                queuedPrintError("Loading configuration from '\(path)'")
                self.init(yamlConfig: yamlConfig)!
                configPath = fullPath
                return
            } else {
