     drawStarFunction()
 
 
-updateRadiusSlider = (position, value) ->
-  $(".rangeslider__handle", this.$range).text(value)
-  refreshStarPath()
-
-updatePercentageSlider = (position, value) ->
-  $(".rangeslider__handle", this.$range).text(value + "%")
-  refreshStarPath()
-
-
-updateUriQuery = (updateFunction) ->
-  uri.search (updateFunction)
+updateSlider = (sliderElement, value) ->
+  $(".rangeslider__handle", sliderElement.$range).text(value)
+  refreshStarPath()
+
+
+updateUrlQuery = (key, value) ->
+  uri.search (queryParams) ->
+    queryParams[key] = value
+    return
   history.replaceState(null, "", uri.resource())
 
-updateUrlWithShape = (value) ->
-  updateUriQuery (queryParams) ->
-    queryParams.s = value
-    return
-
-updateUrlWithRadius = (position, value) ->
-  updateUriQuery (queryParams) ->
-    queryParams.r = value
-    return
-
-updateUrlWithStraightPercentage = (position, value) ->
-  updateUriQuery (queryParams) ->
-    queryParams.l = value
-    return
-
-updateUrlWithControlPercentage = (position, value) ->
-  updateUriQuery (queryParams) ->
-    queryParams.c = value
-    return
-
-updateUrlWithForeground = (e, color) ->
-  updateUriQuery (queryParams) ->
-    queryParams.fg = color.toHex()
-    return
-
-updateUrlWithBackground = (e, color) ->
-  updateUriQuery (queryParams) ->
-    queryParams.bg = color.toHex()
-    return
 
 initializeOptions = () ->
   uri = new URI()

    allowEmpty: true
    move: refreshBackground
    change: refreshBackground
  }).on("dragstop.spectrum", updateUrlWithBackground)

  refreshForeground($("#fg-color-picker").spectrum("get"))
  refreshBackground($("#bg-color-picker").spectrum("get"))

  $innerRadius.rangeslider {
    polyfill: false
    onSlide: updateRadiusSlider
    onSlideEnd: updateUrlWithRadius
  }
  $innerRadius.val(options.r).change()

  $straightPercentage.rangeslider {
    polyfill: false
    onSlide: updatePercentageSlider
    onSlideEnd: updateUrlWithStraightPercentage
  }
  $straightPercentage.val(options.l).change()

  $controlPercentage.rangeslider {
    polyfill: false
    onSlide: updatePercentageSlider
    onSlideEnd: updateUrlWithControlPercentage
  }
  $controlPercentage.val(options.c).change()

    showButtons: false
    color: options.fg
    move: refreshForeground
  }).on("dragstop.spectrum", (_, value) -> updateUrlQuery("fg", value))

  $("#bg-color-picker").spectrum({
    flat: true
