replaced ill suited lodash functions with appropriate ones