Replace global Hash usage with TS::Cache.