Refactoring module of test/ext/redis; using closure variables;