Update with code review from @yutakahirano