Continued moving cache stuff to its own class; TODO: investigate failing tests