Minor refactoring in add-bat.