this class has grown quite bloated.  lots of useful stuff ... perhaps worth a refactor at some point (but fine for now obviously, no worse than it was!)