small refactor of model loading