Rewriting cache as a singleton