[REFACTOR] extract connection class