$shared service to avoid using $rootScope