refactor view model factory