Refactor ConnectionHelper