some refactoring for hypothesis