Optimized the code for the in_packet