A bit of refactoring of the tests to reduce duplication

RED GREEN REFACTOR

like a boss