Refactor Model_loader.