 VAR is a string with value `packages', `pre-extensions' or `post-extensions'."
   (let ((result (make-hash-table :size 512)))
     (dolist (layer layers)
-      (let* ((layer-sym (car layer))
-             (dir (plist-get (cdr layer) :dir))
-             (pkg-file (concat dir (format "%s.el" file))))
+      (let ((name (oref layer :name))
+            (pkg-file (concat (oref layer :dir)
+                              (format "%s.el" file))))
         (when (file-exists-p pkg-file)
-          (unless (configuration-layer/layer-usedp layer-sym)
+          (unless (configuration-layer/layer-usedp name)
             (load pkg-file))
-          (let* ((layer-name (symbol-name layer-sym))
-                 (packages-var (intern (format "%s-%s" layer-name var))))
+          (let ((packages-var (intern (format "%S-%s" name var))))
             (when (boundp packages-var)
               (dolist (pkg (eval packages-var))
-                (puthash pkg (cons layer-sym (ht-get result pkg)) result)))))))
+                (puthash pkg (cons name (ht-get result pkg)) result)))))))
     result))
+
+(defun configuration-layer//declare-used-package (pkg)
+  ""
+  )
 
 (defun configuration-layer/get-packages (layers)
   "Read `layer-packages' lists for all passed LAYERS and return a hash table


(defun configuration-layer/init-layers ()
  "Declare default layers and user layers from the dotfile by filling the
`configuration-layer-layers' variable."
  (setq configuration-layer-paths (configuration-layer//discover-layers))
  (if (eq 'all dotspacemacs-configuration-layers)
      (setq dotspacemacs-configuration-layers
            ;; spacemacs is contained in configuration-layer-paths
            (ht-keys configuration-layer-paths))
    (setq configuration-layer-layers
          (list (configuration-layer//declare-used-layer 'spacemacs))))
  (setq configuration-layer-layers
        (append (configuration-layer//declare-used-layers
                 dotspacemacs-configuration-layers) configuration-layer-layers)))

(defun configuration-layer//declare-used-layers (layers)
  "Declare the passed configuration LAYERS.
LAYERS is a list of layer symbols."
  (reduce (lambda (acc elt) (push elt acc))
          (mapcar 'configuration-layer//declare-used-layer (reverse layers))
          :initial-value nil))

(defun configuration-layer//declare-used-layer (layer)
  "Declare a layer with NAME symbol. Return a cons cell (symbol . plist)
where `symbol' is the name of the layer and `plist' is a property list with
the following keys:
- `:dir'       the absolute path to the base directory of the layer.
- `:ext-dir'   the absolute path to the directory containing the extensions."
  (let* ((name-sym (if (listp layer) (car layer) layer))
         (name-str (symbol-name name-sym))
         (base-dir (configuration-layer/get-layer-path name-sym)))
    (if base-dir
        (let* ((dir (format "%s%s/" base-dir name-str))
               (ext-dir (format "%sextensions/" dir))
               (plist (append (list :dir dir :ext-dir ext-dir)
                              (when (listp layer) (cdr layer)))))
          (cons name-sym plist))
      (spacemacs-buffer/warning "Cannot find layer %S !" name-sym)
      nil)))

(defun configuration-layer//set-layers-variables (layers)
  "Set the configuration variables for the passed LAYERS."
  (dolist (layer layers)
    (let ((variables (spacemacs/mplist-get layer :variables)))
      (while variables
        (let ((var (pop variables)))
          (if (consp variables)

     (ht-size configuration-layer-all-pre-extensions)
     (ht-size configuration-layer-all-post-extensions)))

(defun configuration-layer/get-layers-list ()
  "Return a list of all discovered layer symbols."
  (ht-keys configuration-layer-paths))

(defun configuration-layer/get-layer-property (layer slot)
  "Return the value of SLOT for the given LAYER."
  (slot-value (object-assoc layer :name configuration-layer-used-layers) slot))

(defun configuration-layer/get-layer-path (layer)
  "Return the path for LAYER symbol."
  (ht-get configuration-layer-paths layer))

(defun configuration-layer//get-packages-dependencies ()
  "Returns a hash map where key is a dependency package symbol and value is
