HPCC-9420 Clean more duplicated code

Signed-off-by: Kevin Wang <kevin.wang@lexisnexis.com>