Refactoring the test