     {
         var item:* = dataProvider.getItemAt(index);
 
-        if (!(item is IGraphicElement))
-            item = getItemSkin(item);
-
-        return LayoutItemFactory.getLayoutItemFor(item);
-    }
-    
-    protected function itemAdded(item:*, index:int):void
-    {
-        var child:DisplayObject;
+        var itemSkin:Object = getItemSkin(item);
+
+        return LayoutItemFactory.getLayoutItemFor(itemSkin);
+    }
+    
+    protected function itemAdded(item:Object, index:int):void
+    {
+        var childDO:DisplayObject;
                 
         if (item is GraphicElement) 
         {
-            item.elementHost = this;
+            var graphicItem:GraphicElement = GraphicElement(item);
+            graphicItem.elementHost = this;
         
             // If a styleable GraphicElement is being added,
             // build its protochain for use by getStyle().
             if (item is IStyleClient)
                 IStyleClient(item).regenerateStyleCache(true);
+                
+            childDO = createVisualForItem(graphicItem);
         }   
         else
         {     
             // This always adds the child to the end of the display list. Any 
             // ordering discrepancies will be fixed up in assignDisplayObjects().
-            child = addItemToDisplayList(createVisualForItem(item), item);
-        }
+            childDO = createVisualForItem(item);
+        }
+        
+        addItemToDisplayList(childDO, item);
         
         dispatchEvent(new ItemExistenceChangedEvent(
                       ItemExistenceChangedEvent.ITEM_ADD, false, false, item));

            }
        } */
        
        dispatchEvent(new FlexEvent(FlexEvent.CONTENT_CHANGED)); 
    }
    
    protected function createVisualForItem(item:*):DisplayObject
    {
        var itemSkin:DisplayObject;
        
        if (item === undefined || item === null)
            throw new Error("DataGroup content can not contain null or undefined items.");
        
        // Rules for skin lookup:
        // 0. if the item is a deferred instance, instantiate it and fall through to the other item(s)
        // 1. if the item is a display object, use it directly
        // 2. if itemRendererFunction is defined, call it to get the renderer factory and instantiate it
        // 3. if itemRenderer is defined, instantiate one
        // 4. create a Label component and call toString() on the item
            
        // 0. if the item is a deferred instance, instantiate it and fall through to the other item(s)
        if (item is IDeferredInstance)
            item = IDeferredInstance(item).getInstance();
        // TODO (rfrishbe): do deferred instantiation in DataGroup?
        
        // 1. if the item is a display object, use it directly unless the alwaysUseItemRenderer
        // flag is set.
        if (item is DisplayObject && itemRendererFunction == null)
            itemSkin = item;
            
        // 2. if itemRendererFunction is defined, call it to get the renderer factory and instantiate it
        if (!itemSkin && itemRendererFunction != null)
        {
            var rendererFactory:IFactory = itemRendererFunction(item);
            
            if (rendererFactory)
                itemSkin = rendererFactory.newInstance();
            else if (item is DisplayObject)
                itemSkin = item;
        }
        
        // 3. if itemRenderer is defined, instantiate one
        if (!itemSkin && itemRenderer != null)
            itemSkin = itemRenderer.newInstance();
                    
        // 4. create a Label component and call toString() on the item
        if (!itemSkin)
        {
            // No custom skin, use a Label
            itemSkin = new Label();
            Label(itemSkin).condenseWhite = true;
            Label(itemSkin).htmlText = item.toString();
        }
        
        // Set the skin data to the item, but only if the item and skin are different


        // TODO EGeorgie: we need to optimize this, iterating through all the elements is slow.
        // Iterate through the graphic elements, clear their graphics and draw them
        var length:int = dataProvider ? dataProvider.length : 0;
        for (var i:int = 0; i < length; i++)
        {
            var element:GraphicElement = dataProvider.getItemAt(i) as GraphicElement;
