Code Refactor.

Starting to move view logic to view model.