DRY'd up some tests