move autoloading functionality to the autoloader function