Train framework: divide into Yizhong and Bean parts.

search for TODO Yizhong and TODO Bean to fill the functions.