Adapt to review comments. Thanks @oterral