refactoring
end-to-end on opening a connection