I wanted to use a closure to keep the cache and mutex private.