Composite pattern implementation