removed WeakMap and added simple mapping
toJSON is useless here