Tidy up

Lots of changes.