Just some simple code movement to tidy up and make further work on #235 easier
Windows failure is #310 (not so intermittent eh)