              (dir (plist-get (cdr layer) :dir))
              (pkg-file (concat dir "packages.el")))
         (when (file-exists-p pkg-file)
-          (configuration-layer/load-file pkg-file)
+          (load pkg-file)
           (let ((excl-var (intern (format "%s-excluded-packages"
                                           (symbol-name layer-sym)))))
             (when (boundp excl-var)


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

(defvar configuration-layer--loaded-files '()
  "List of loaded files.")

(defun configuration-layer/sync ()
  "Synchronize declared layers in dotfile with spacemacs."

             (dir (plist-get (cdr layer) :dir))
             (pkg-file (concat dir (format "%s.el" file))))
        (when (file-exists-p pkg-file)
          (load pkg-file)
          (let* ((layer-name (symbol-name layer-sym))
                 (packages-var (intern (format "%s-%s" layer-name var))))
            (when (boundp packages-var)
