Fix and refactor redis command