General cleanup, threadsafe cache