refactored redis connection into a facotry, renamed for clarity, removed some dependancies