clean up code for TCMETAlgo
clean up code for TCMETAlgo further