Refactoring the tests