 
 let VERBOSE = true
 
+struct Const {
+    enum UserDefaults: String {
+        case repo = "repo"
+        case githubAPIUrl = "github_api_url"
+        case githubToken = "github_token"
+        case lastSyncDate = "last_sync_date"
+    }
+}
+
 @NSApplicationMain
 class AppDelegate: NSObject, NSApplicationDelegate {
     let statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.squareLength)
     let popover = NSPopover()
     let menu = NSMenu()
     let syncMenuItem = NSMenuItem(title: "Sync", action: #selector(sync(sender:)), keyEquivalent: "s")
+    let configRepoMenuItem = NSMenuItem(title: "Set Repo", action: #selector(showRepoConfig(sender:)), keyEquivalent: "r")
+    let configGithubAPIUrlMenuItem = NSMenuItem(title: "Set Github API Url", action: #selector(showGithubAPIUrlConfig(sender:)), keyEquivalent: "a")
+    let configGithubTokenMenuItem = NSMenuItem(title: "Set Github Token", action: #selector(showGithubTokenConfig(sender:)), keyEquivalent: "t")
+    let configShowMenuItem = NSMenuItem(title: "Show Config", action: #selector(showCurrentConfig(sender:)), keyEquivalent: "")
+    let configResetMenuItem = NSMenuItem(title: "Reset Config", action: #selector(resetConfig(sender:)), keyEquivalent: "")
     let quitMenuItem = NSMenuItem(title: "Quit", action: #selector(terminate(sender:)), keyEquivalent: "q")
     let environment: [String: String] = [:]
-    var lastSyncDate = Date()
     let dateFormatter = DateFormatter()
-    let repo = "git@github.com:ivanfoong/xcode-swift-snippets.git" // TODO: needs to be configurable
     var isSyncing = false
-    let githubToken = "<github token>"
+    
+    var repo: String {
+        get {
+            return UserDefaults.standard.string(forKey: Const.UserDefaults.repo.rawValue) ?? "git@github.com:ivanfoong/xcode-swift-snippets.git"
+        }
+        set {
+            UserDefaults.standard.set(newValue, forKey: Const.UserDefaults.repo.rawValue)
+        }
+    }
+    
+    var githubToken: String {
+        get {
+            return UserDefaults.standard.string(forKey: Const.UserDefaults.githubToken.rawValue) ?? ""
+        }
+        set {
+            UserDefaults.standard.set(newValue, forKey: Const.UserDefaults.githubToken.rawValue)
+        }
+    }
+    
+    var githubAPIUrl: String {
+        get {
+            return UserDefaults.standard.string(forKey: Const.UserDefaults.githubAPIUrl.rawValue) ?? "https://api.github.com/repos/ivanfoong/xcode-swift-snippets"
+        }
+        set {
+            UserDefaults.standard.set(newValue, forKey: Const.UserDefaults.githubAPIUrl.rawValue)
+        }
+    }
+    
+    var lastSyncDate: Date? {
+        get {
+            return UserDefaults.standard.object(forKey: Const.UserDefaults.lastSyncDate.rawValue) as? Date
+        }
+        set {
+            UserDefaults.standard.set(newValue, forKey: Const.UserDefaults.lastSyncDate.rawValue)
+        }
+    }
     
     func applicationDidFinishLaunching(_ aNotification: Notification) {
         // Insert code here to initialize your application

                self.completedSyncing()
            }
        }
    }
    
    private func completedSyncing() {

            return
        }
        
        var request = URLRequest(url: URL(string: "\(githubAPIUrl)/pulls")!)
        request.httpMethod = "POST"
        request.httpBody = httpBody
        request.addValue("token \(githubToken)", forHTTPHeaderField: "Authorization")
