 
 (defun jail-windows--get-option (frame option)
   "[Internal] Retrieve a frame-local value."
-  (cdr (assq option
-             (frame-parameter (or frame (selected-frame))
-                              'jail-windows-options))))
-
-(defun jail-windows--set-option (frame option value)
+  (cdr (assq option (frame-parameter frame 'jail-windows-options))))
+
+(defun jail-windows--set-option (frame key value)
   "[Internal] Set a frame-local value."
-  (let ((options (frame-parameter (or frame (selected-frame))
-                                  'jail-windows-options)))
-    (setq options (cons (cons option value)
-                        (assq-delete-all option options)))
-    (modify-frame-parameters (or frame (selected-frame))
+  (let* ((options (frame-parameter frame 'jail-windows-options))
+         (option (assq key options)))
+    (if option
+        (setcdr option value)
+      (push (cons key value) options))
+    (modify-frame-parameters frame
                              `((jail-windows-options . ,options)))))
 
 (defun jail-windows--prompt-for-layout (prompt
                                         &optional predicate initial-input)
   "[Internal] Prompt the user for a layout."
-  (let ((choices (list (-map #'car jail-windows--registered-layouts)))
-        (choice))
-    (setq choice (completing-read prompt choices predicate t initial-input))
+  (let* ((choices (list (-map #'car jail-windows--registered-layouts)))
+         (choice (completing-read prompt choices predicate t initial-input)))
     (if (equal choice "")
         (car (car choices))
       (intern choice))))
 
+(defun jail-windows--message (type &rest args)
+  "[Internal] Debug messaging."
+  (when (let ((-compare-fn #'eq)) (-contains? jail-windows-debug-messages type))
+    (apply #'message args)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Layout Registration
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (defun jail-windows/register-layout (layout-name layout-def)
-  "Register a new layout"
+  "Register a new layout
+
+TODO: Describe layout
+
+Remember that 'unassigned is a special group name and can't be directly
+assigned."
   (jail-windows/unregister-layout layout-name)
   (push (cons layout-name layout-def)
         jail-windows--registered-layouts))

(require 'dash)
(require 'dash-functional)

;;; Customization
(defcustom jail-windows-register-builtin-layouts t
  "Flag to determine whether jail-windows-mode should automatically register
the builtin layouts."

                      "^\\*Backtrace\\*$"
                      "^\\*Colors\\*$"
                      "^\\*Compile-Log\\*$"
                      "^\\*Customize "
                      "^\\*ediff.*\\*$"
                      "^\\*e?shell"
                      "^\\*Help\\*$"
