ECMS-5764 remove some redundancy code