Use WeakMap (ES6) instead of custom Map.