replace typof obj === 'string' with _.isString(obj)