Code Refactor:  moved some bits of logic to viewModel

Fixes rSKc5b27f0479d4 and rSKc43ad22a10a2