   (let ((obj (configuration-layer/get-layer layer-name)))
     (when obj (memq layer-name configuration-layer--used-layers))))
 
-(defun  configuration-layer/layer-lazy-installp (layer-name)
-  "Return non-nil if LAYER-NAME is the name of a layer to be lazily installed."
-  (let ((obj (configuration-layer/get-layer layer-name)))
-    (when obj (oref obj :lazy-install))))
-
 (defun configuration-layer/package-usedp (name)
   "Return non-nil if NAME is the name of a used package."
   (let ((obj (configuration-layer/get-package name)))

            (delq nil
                  (mapcar
                   (lambda (x)
                     (and (memq x configuration-layer--used-distant-packages)
                          (configuration-layer/get-package x)))
                   (oref layer :packages))))
           (config-pkgs
            (delq nil (mapcar
                       (lambda (x)
                         (let ((pkg (configuration-layer/get-package x)))
                           (cfgl-package-set-property pkg :lazy-install nil)
                           pkg))
                       (oref layer :packages)))))
      (let ((last-buffer (current-buffer))
            (sorted-inst (configuration-layer//sort-packages inst-pkgs))
            (sorted-config (configuration-layer//sort-packages config-pkgs)))
        (spacemacs-buffer/goto-buffer)
        (goto-char (point-max))
        (oset layer :lazy-install nil)
        (configuration-layer//install-packages sorted-inst)
        (configuration-layer//configure-packages sorted-config)
        (configuration-layer//load-layer-files layer '("keybindings.el"))
        (switch-to-buffer last-buffer)))))

(defun configuration-layer//install-packages (packages)

    (let ((extensions (spacemacs/mplist-get props :extensions)))
      (when (configuration-layer/layer-usedp layer-name)
        (let* ((layer (configuration-layer/get-layer layer-name))
               (packages (when layer (cfgl-layer-owned-packages layer)))
               (package-names (mapcar (lambda (x) (oref x :name)) packages)))
          ;; set lazy install flag for a layer if and only if its owned
          ;; distant packages are all not already installed
          (let ((lazy (cl-reduce
                       (lambda (x y) (and x y))
                       (mapcar
                        (lambda (p)
                          (let ((pkg (configuration-layer/get-package p)))
                            (or (not (eq layer-name (car (oref pkg :owners))))
                                (null (package-installed-p
                                       (oref pkg :name))))))
                        (configuration-layer//get-distant-packages
                         package-names t))
                       :initial-value t)))
            (oset layer :lazy-install lazy)
            (dolist (pkg packages)
