Further tidy up of code structure.

Aesthetics only.