Refactored connection config