commenting the code, refactoring into TCPService