move helper functions to lodash service