refactor async connection