fix whitespace and other cleanup

Cleanup based on feedback from @cvan and @ngokevin.