Factored out isAddMode and isToggleMode so they can be used globally.