Change application structure to use TCP sockets