utility functions as a service for angular