implement review comment by @ahocevar