some refactoring in the tests