refactored redis with suptyping