         )
     }
     
-    var data: NSData? {
-        let json = [
+    var jsonValue: [String: AnyObject] {
+        let json: [String: AnyObject] = [
             "interval": browser.switchInterval,
             "URLs": browser.tabs.map{ $0.URL.absoluteString }
         ]
-        let data = try? NSJSONSerialization.dataWithJSONObject(json, options: [])
-        return data
+        return json
     }
 }
// MARK: Persistance

extension BrowserReducer {
    private var statePersistanceURL: NSURL {
        let manager = NSFileManager.defaultManager()
        let URL = try! manager.URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: true)

    }
    
    func loadState(state: AppState) -> AppState {
        return AppState(json: defaults.dictionaryRepresentation()) ?? state
    }
    
    func saveState(state: AppState) -> AppState {
        let data = state.jsonValue
        defaults.setValuesForKeysWithDictionary(data)
        defaults.synchronize()
        return state
    }
}
