I had a lot of code repetition in the test scripts, so I tried to decrease that a bit