added Composite pattern