refactored redis stuff