cleanup based on suggestions in pull request #809