Name cleaning

@josephwb I pulled in your pull request, and did some cleanup on related code. please review and merge.