use lodash.map & small cleanup