refactor pcs_cumest by deleting duplicated functions