Created function for creating a Connection out of a raw connection