some refactoring for test_helper