Refactored Tcp classes