factored common code out into giggle