Reworked design to follow view model controller pattern