udp cmd refactor