refactoring the test