Refactored the Cache