Composite design pattern implementation