minor clean up for easier debugging ...
rewrite test bailout rules and tidy up