Refactor the tests