nicer names, new top level state machien for writing udp