refactor-modify $scope.category