Move Cache & ThreadSafeCache to their own classes