It would be nice if this could be DRY'd up.