Refactor redis configuration