code review comments from #4658

@dangoor