Refactoring view model