refactoring redis support