Pruning and optimising items in $scope