some refactoring/encapsulation for the connection establishment events