         viewSize = CCDirector.sharedDirector().viewSize()
         super.init()
         userInteractionEnabled = true
-        createStaticExample()
+        initializeLayer()
+        addRotatingLight()
+        initializeStaticExample()
     }
 
-    func spriteFrameForImage(image : NSImage) -> CCSpriteFrame! {
+    class func spriteFrameForImage(image : NSImage) -> CCSpriteFrame! {
         let source = CGImageSourceCreateWithData(image.TIFFRepresentation, nil)
         let img = CGImageSourceCreateImageAtIndex(source, 0, nil)
 

        let action = CCActionRotateBy.actionWithDuration(2, angle: 180) as CCActionInterval
        lightContainer.runAction(CCActionRepeatForever(action: action))

        sprite.effect = effect!
        self.addChild(background)
        self.addChild(sprite)
    }

    // This should be moved to a move logical place
    func resizeSprite(sprite: CCSprite, toWidth: Float, toHeight: Float) {
        sprite.scaleX = toWidth / Float(sprite.contentSize.width)
        sprite.scaleY = toHeight / Float(sprite.contentSize.height)
    }

    func resizeSpriteWithoutWarp(sprite: CCSprite, toWidth: Float, toHeight: Float) {
        let scale = min(toWidth / Float(sprite.contentSize.width),
            toHeight / Float(sprite.contentSize.height))
        sprite.scaleX = scale

        let groups = ["group_name"]
        let light = CCLightNode(type: CCLightType.Point, groups: groups,
            color: CCColor.whiteColor(), intensity: 0.5)
        light.position.x = previewSprite.contentSize.width / 2.0
        light.anchorPoint = CGPointMake(0.5, 0.5)

        let lightContainer = CCNode()
        lightContainer.position = CGPointMake(
            previewSprite.contentSize.width/2, sprite.contentSize.height/2)

        lightContainer.addChild(light)

        previewSprite.addChild(lightContainer)

        let sunIcon: CCSprite = CCSprite(imageNamed: "light64.png")
        sunIcon.contentSize = CGSizeMake(32.0, 32.0)
