Minor refactoring, no functionality change.