Revert "Connection refactoring"

This reverts commit 1d9bd9518f30e73fa5503f4aa0ff980e2f328995.