Improves redis connection code for caching & v0.5.7