Can you consolidate this into a utility method and add it to the BaseService.js