refactoring Connection, poprawki drobne