replaced util.toHash to _.indexBy