Use lodash rather than reimplementing some of its methods