   (log/debug "get-application-info")
   (later #(on-success (get @state :application-info))))
 
-(defn factory-reset [_])
+(defn factory-reset [args]
+  (log/debug "factory-reset")
+  (reset-state)
+  (get-application-info args))
+
 (defn install-applet [_])
 (defn install-cash-applet [_])
 
-(def kk1-password "000000")
-(def default-puk "000000000000")
 (defn init-card [{:keys [pin on-success]}]
   (reset! initialization true)
   (swap! state assoc :application-info
          {:free-pairing-slots     5
-          :app-version            "2.2"
+          :app-version            "3.0"
           :secure-channel-pub-key "04c3071768912a515c00aeab7ceb8a5bfda91d036f4a4e60b7944cee3ca7fb67b6d118e8df1e2480b87fd636c6615253245bbbc93a6a407f155f2c58f76c96ef0e",
           :key-uid                "",
           :instance-uid           "1b360b10a9a68b7d494e8f059059f118"
           :paired?                false
           :has-master-key?        false
+          :pin-retry-counter      3
+          :puk-retry-counter      5
           :initialized?           true})
-  (swap! state assoc :pin pin)
+  (swap! state assoc :pin pin :puk default-puk :password kk1-password)
   (later
    #(on-success {:password kk1-password
                  :puk      default-puk

  (when f
    (utils/set-timeout f 500)))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn start-nfc [{:keys [on-success]}]

                   (reset! derived-acc
                           {:root-key root-data
                            :derived  derived-data-extended})))))))))))
  (when (= password (get @state :password))
    (do
      (swap! state assoc-in [:application-info :paired?] true)
      (later #(on-success (str (rand-int 10000000)))))))
