mavtester: tidy up the code a bit