Make the connection class more generic