extract buildCdo Method in main