Refactored model loader