More minor refactoring of stratification code.