refactor packages
connection / disconnection with tcp communication