Refactored Configuration and Connection managment