Refactored ConnectionManager