implemented singleton and composite