Refactoring some hypothesis tests