implemeted composite pattern.