refactoring (using MainWindowModel)