Refactor autoloader to clean it up a bit.

Signed-off-by: Se7enChat <se7enchat@zoho.com>