refactor redis state