Implement Composite design pattern.