some cleanup suggested in the PR review, and some more cleanup