Rewrite to better support loading of models within models.