Replace "use a ConcurrentHashMap and pray" with explicit locking