INT-3460: change code as Gary's comments