Sending packets and got rid of useless code