Lot of rewriting...

Need to take a different approach to simplify things, reducing use of
'any ptr' to a minimum.