refactored tests into helper method