     }
     
     func loadState(state: AppState) -> AppState {
-        guard let data = NSData(contentsOfURL: statePersistanceURL),
-            loadedState = AppState(data: data) else {
-                return state
-        }
-
-        return loadedState
+        return AppState(json: defaults.dictionaryRepresentation()) ?? state
     }
     
     func saveState(state: AppState) -> AppState {
-        if let data = state.data {
-            do {
-                try data.writeToURL(statePersistanceURL, options: [])
-            } catch {
-                assertionFailure("Failed to persist JSON")
-            }
-        } else {
-            assertionFailure("JSON is invalid")
-        }
+        let data = state.jsonValue
+        defaults.setValuesForKeysWithDictionary(data)
+        defaults.synchronize()
         return state
     }
 }

}

private extension AppState {
    init?(data: NSData) {
        guard let json = try? NSJSONSerialization.JSONObjectWithData(data, options: []) else {
            return nil
        }
        guard let interval = json["interval"] as? Double,
            URLStrings = json["URLs"] as? [String],
            URLs: [NSURL] = URLStrings.flatMap({ NSURL(string: $0) }) else {

        )
    }
    
    var jsonValue: [String: AnyObject] {
        let json: [String: AnyObject] = [
            "interval": browser.switchInterval,
            "URLs": browser.tabs.map{ $0.URL.absoluteString }
        ]
        return json
    }
}