Minor refactoring of my last patch.