apply code review from #1118