clean up code in METAlgo