adds more modularity and usage of $http