clean and simplify mov_write_packet