further improvements on CPS conversion