hmm  i will see this code started off as a straight port from the bash  which is why there is globals like this i think i will kill off the testing arg completely once i am happy this code actually works  and the unittests give good coverage  it should actually already so in light of this being destined for death  i am not sure i want to bother with this restructure if i planned on keeping it  i would def agree with your class object approach 