Reduce duplication a bit.