refactored redis cache.