refactoring network code, now tcp socket is running in a thread