Move cache object into its own class