Moving unneeded variables off the $scope