some code cleaning and added some code for another strategy for udp packeting