some refactoring of tests