redis module refactoring