pretty big refactor to accomodate more types of test scripts