Refactored custom autoloader