Improved autoloading functionality