some refactoring for autoloads