minor refactor to improve comments and error recovery
Merge pull request #4071 from WalterBright/exp-refactor

minor refactor to improve comments and error recovery