moved connection creation to new class