refactored autoloader implementation