Factored out 'connection' class def into new file