change to angularjs service