Refactor the tests a bit to remove unnecessary code