Improvements based on the comments for commit
6513ef568204f21191eb385e49df3b59550027a2.