Minor refactoring and change.