This is only used in one place, so should be inlined.