       color: '#ff0'
     }
   }
-
   restartDelay = 3000
-
   buttons = null
-
+  moveToPosition = (element, position, scale) ->
+    element.attr { transform: "translate(#{position}) scale(#{scale})" }
   Snap.load '/assets/images/buttons.svg', (canvas) ->
     buttons = canvas.select 'g#Buttons'
     snap.append buttons
-
     $.each config, (name, item) ->
       group = buttons.select 'g#'+item.id
-      group.attr { transform: zero }
-      buttons.selectAll('g#'+item.id+' > g').attr { transform: 'translate('+item.initial+') scale('+scale.initial+')' }
-      buttons.select('g#'+item.id+'-title').attr { transform: 'translate('+item.initial+') scale('+scale.initial+')' }
+      moveToPosition group, zero, ''
+      moveToPosition buttons.selectAll('g#'+item.id+' > g'), item.initial, scale.initial
+      moveToPosition buttons.select('g#'+item.id+'-title'), item.initial, scale.initial
       moveButton item, 0
-
   moveButton = (item, index) ->
     index = 0 if index > 11
     elementToMove = buttons.selectAll('g#'+item.id+' > g')[index]

      $('.font-header header').addClass('fixed')
      $('#styles').addClass('with-bumper')
      fixHeader = false
      $(window).scrollTo $($(this).attr('href')), { duration: 300, offset: -offset }
    else
      $('.font-header').removeClass('fixed')
      $('.font-header header').removeClass('fixed')
      $('#styles').removeClass('with-bumper')
      fixHeader = true
      $(window).scrollTo 0, { duration: 500 }
    $('.sections a.active').removeClass('active')
    $(this).addClass('active')
    e.stopPropagation()

    if email != '' and emailIsValid(email)
      e.stopPropagation()
      $('.message').html('<h2>Thank you! Check your email soon.</h2>')
      setTimeout hideWishedBox, 10*defaultSpeed
    else
      $('.message').html('<h2>Please provide email in valid format!</h2>')
      setTimeout clearMessage, 10*defaultSpeed
    false

refreshWished = (wished) ->
