Split `ack_nr` assignment into more sensible places.