descrambler: move some of the reader logic to the common code