Changed autoloader to a single function