Refactoring connection config retrieval