code review comments from #4658

@dangoor fixed your comments from #4658