typesviewmodel refactoring