Can you use an ES6 Map here instead?