refactoring of viewmodels