             Spree.Checkout[countryId] =
               states: data.states
               states_required: data.states_required
-            fillStates(Spree.Checkout[countryId], region)
+            Spree.fillStates(Spree.Checkout[countryId], region)
         else
-          fillStates(Spree.Checkout[countryId], region)
+          Spree.fillStates(Spree.Checkout[countryId], region)
 
-    fillStates = (data, region) ->
+    Spree.fillStates = (data, region) ->
       statesRequired = data.states_required
       states = data.states
 

      else
        ($ '#shipping .inner').show()
        ($ '#shipping .inner input, #shipping .inner select').prop 'disabled', false
        updateState('s')
    
    update_shipping_form_state order_use_billing

    getCountryId = (region) ->
      $('#' + region + 'country select').val()

    Spree.updateState = (region) ->
      countryId = getCountryId(region)
      if countryId?
        unless Spree.Checkout[countryId]?
