refactoring viewmodels