refactor and add redis_class option
add test