simplify tcp connection handlers