KCINFR-979: cleaning up code