added view model logic to manage the UI
[#18]