angular service refactor