   (let [options           (merge {:size [500 300]} (apply hash-map opts))
         size              (validate-size! (:size options))
         renderer          (or (:renderer options) :p2d)
-        fns               (dissoc options :title :size :key-pressed
-                                  :key-released :key-typed :mouse-pressed
-                                  :mouse-released :mouse-moved :mouse-dragged
-                                  :focus-gained :focus-lost :mouse-entered
-                                  :mouse-exited :mouse-clicked :setup :keep-on-top :renderer)
-        mode              (if (< 2 (count (:size options)))
-                            (nth (:size options) 2)
-                            :p2d)
-        fns               (merge {:draw (fn [] nil)} fns)
+        draw-fn           (or (:draw options) (fn [] nil))
+        setup-fn          (or (:setup options) (fn [] nil))
         key-pressed-fn    (or (:key-pressed options) (fn [] nil))
         key-released-fn   (or (:key-released options) (fn [] nil))
         key-typed-fn      (or (:key-typed options) (fn [] nil))

                              (apply applet-set-size size-vec))
                            (when-let [f (:setup options)]
                              (f)))
        methods           (into {} (map fix-mname fns))
        frame             (atom nil)
        state             (atom nil)
        keep-on-top?      (atom (:keep-on-top options))

                            (setup
                              ([] (binding [*applet* this
                                            *state* state]
                                    (setup-fn))))

                            (draw
                              [] (binding [*applet* this
                                           *state* state]
                                   (draw-fn))))]
    (applet-run prx renderer @keep-on-top?)
    prx))

(defmacro defapplet
