worried about a memleak here. Can we use a WeakHashMap protected with a mutex?