Refactor the bundle autoloading