```coffeescript
Darkswarm.directive "darkerBackground", ->
  restrict: "A"
  link: (scope, elm, attr)->
    elm.closest('.page-view').toggleClass("with-darker-background", true)
```

Refactor darker-background directive, extract method
user
```coffeescript
Darkswarm.directive "darkerBackground", ->
  restrict: "A"
  link: (scope, elm, attr)->
    toggleClass = (value) ->
      elm.closest('.page-view').toggleClass("with-darker-background", value)

    toggleClass(true)
```
assistant