Refactored the way of getting Redis connections