Move code from scratch-pack to buffer-pack.