refactoring
refactored model manager