Refactored more logic into view model
Working unit tests for view models