Moved establish_connection to a base class