Moved update logic to $scope