improvements for pull request #11