Modularize test scripts a bit