Revert "Refactor the dependency loading"

This reverts commit 886c4da302dbbeaf8fedb016505591d2a344d206.