         (when (file-exists-p pkg-file)
           (load pkg-file)
           (dolist (pkg (eval (intern (format "%s-packages" (symbol-name sym)))))
-            (unless (member pkg dotspacemacs-excluded-packages)
-              (contribsys//add-layer-to-hash pkg sym spacemacs-all-packages))))
+            (contribsys//add-excluded-packages sym)
+            (contribsys//add-layer-to-hash pkg sym spacemacs-all-packages)))
         ;; extensions
         (when (file-exists-p ext-file)
           (load ext-file)
           (dolist (pkg (eval (intern (format "%s-pre-extensions"
                                              (symbol-name sym)))))
-            (unless (member pkg dotspacemacs-excluded-packages)
-              (contribsys//add-layer-to-hash
-               pkg sym spacemacs-all-pre-extensions)))
+            (contribsys//add-excluded-packages sym)
+            (contribsys//add-layer-to-hash pkg sym
+                                           spacemacs-all-pre-extensions))
           (dolist (pkg (eval (intern (format "%s-post-extensions"
                                              (symbol-name sym)))))
-            (unless (member pkg dotspacemacs-excluded-packages)
-              (contribsys//add-layer-to-hash
-               pkg sym spacemacs-all-post-extensions)))))))
+            (contribsys//add-excluded-packages sym)
+            (contribsys//add-layer-to-hash pkg sym
+                                           spacemacs-all-post-extensions))))))
+  (contribsys//filter-out-excluded-packages)
   ;; number of chuncks for the loading screen
   (let ((total (+ (ht-size spacemacs-all-packages)
                   (ht-size spacemacs-all-pre-extensions)

  "Add LAYER to the list which the value stored in HASH with key PKG."
  (let ((list (ht-get hash pkg)))
    (puthash pkg (add-to-list 'list layer t) hash)))

(defun contribsys/read-packages-and-extensions ()
  "Load all packages and extensions declared in all layers and fill the

(defvar spacemacs-contrib-categories '()
  "List of strings corresponding to category names. A category is a
sub-directory of the contribution directory.")

(defvar spacemacs-excluded-packages-from-layers '()
  "List of all excluded packages declared at the layer level.")

(defvar dotspacemacs-configuration-layer-path '()
  "List of additional paths where to look for configuration layers.
