connection: small refactor, less closures
1.12.1