add composite and factory method patterns.