Refactor to avoid some (mostly hypothetical) races

Tidy up added code to reduce duplicity of X and X_internals.
3853009d92Conrad Irwin committed on 10/19/2023, 3:42:10 AMparent2b11463
13 files changedLine totals unavailable