             else
                 url: null
 
-    exportSpecification = (format, models) =>
+    exportSpecification = (format, appModels) =>
         if format not in ['kml', 'json']
             return null
-        specs = modelsToExportSpecification models
+        specs = modelsToExportSpecification appModels
         url = specs.url
         if url
             uri = URI url


    models = require 'cs!app/models'

    modelsToSelectionType = (models) =>
        { selectedUnits, selectedServices, searchResults, units } = models

        if selectedUnits.isSet()
            return 'single'

                    return 'distance'
        return 'unknown'

    modelsToExportSpecification = (appModels) =>
        { selectedUnits, selectedServices, searchResults, units, divisions } = appModels
        key = modelsToSelectionType appModels
        specs = key: key, size: units.size()
        _.extend specs, switch key
            when 'single'
