refactoring ViewModel