Split out helpers from clicktests