small refactoring of the view model