cleanup for b7687492 to be cherry-pick
cleanup for b7687492 to be cherry-pick

This reverts portions of commit e6374518

cmacq2/kate,jfmcarreira/kate,DickJ/kate,jfmcarreira/kate,sandsmark/kate,DickJ/kate,sandsmark/kate,DickJ/kate,cmacq2/kate,jfmcarreira/kate,sandsmark/kate,DickJ/kate,sandsmark/kate,cmacq2/kate