Refactored everything into a Main view model