refactoring the tests