adapted for lodash