helper functions in service