refactoring ModelEdittor code