Minor refactoring of code. No functional change.