Add a whole load of "final" keywords.

Move a couple of private methods

Remove some unused stuff.

No functional change