Moved logic over to view model.