move autoloading functionality to sepearte file