Moving cache to its own class