   (setq spacemacs-loading-dots-chunk-threshold
         (/ total spacemacs-loading-dots-chunk-count))))
 
-(defun config-system/install-packages ()
+(defun config-system//install-packages ()
   "Install the packages all the packages if there are not currently installed."
   (interactive)
-  (let* ((pkg-list (ht-keys config-system-all-packages))
-         (sorted-pkg-list (mapcar 'intern
-                                  (sort (mapcar 'symbol-name pkg-list)
-                                        'string<)))
-         (not-installed (remove-if 'package-installed-p sorted-pkg-list))
+  (let* ((not-installed (remove-if 'package-installed-p
+                                   config-system-all-packages-sorted))
          (not-installed-count (length not-installed)))
     ;; installation
     (if not-installed

symbol and the value is a list of layer symbols responsible for initializing
and configuring the package.")

(defvar config-system-all-pre-extensions #s(hash-table size 128 data ())
  "Hash table of all declared pre-extensions in all layers where the key is a
extension symbol and the value is the layer symbols responsible for initializing
and configuring the package.")

(defvar config-system-all-post-extensions #s(hash-table size 128 data ())
  "Hash table of all declared post-extensions in all layers where the key is a
extension symbol and the value is the layer symbols responsible for initializing
and configuring the package.")

(defvar config-system-layer-paths #s(hash-table size 128 data ())
  "Hash table of layers locations where the key is a layer symbol and the value

                           (symbol-name layer) pkg)
                  (funcall init-func))))))

(defun config-system//initialize-pre-extension (ext layers)
  "Initialize the pre-extensions EXT from configuration layers LAYERS."
  (config-system//initialize-extension ext layers t))

(defun config-system//initialize-extensions (ext-list &optional pre)
  "Initialize all the declared extensions in EXT-LIST hash table.
If PRE is non nil then the extensions are pre-extensions."
  (let ((func (if pre 'config-system//initialize-pre-extension
                'config-system//initialize-extension))
        (hash (if pre config-system-all-pre-extensions
                config-system-all-post-extensions)))
    (mapc (lambda (x) (funcall func x (ht-get hash x))) ext-list)))

(defun config-system//initialize-extension (ext layers &optional pre)
  "Initialize the extension EXT from the configuration layers LAYERS.
If PRE is non nil then the extension is a pre-extensions."
  (dolist (layer layers)
