Refactored and reformatted autoloader.