added udp server, refactoring