model manager refactoring