Refactor connection proxy factory mechanism