some refactor in test