simplify connect code for redis