             else apiSwitch.setOn no
 
           else
-            if state
-            then @addNewButton.enable()
-            else @addNewButton.disable()
+            toggleButtonState @addNewButton, state
 
     apiSwitch.setDefaultValue @initialAPIAccessState
 

          kd.utils.defer =>
            @apiTokenListView.listController.addItem apiToken

    if @initialAPIAccessState
    then @addNewButton.enable()
    else @addNewButton.disable()

    tabView.addPane apiTokens = new kd.TabPaneView name: 'API Tokens'


    @addSubView tabView


toggleButtonState = (button, state) ->

  if state
  then button.enable()
  else button.disable()
