dry'ed out the test for easier reading of the code