Refactor View and Viewmodel