ch6: refactored code sample, addressed reviewers issues
Merge pull request #116 from gAmUssA/master

ch6: refactored code sample, addressed reviewers issues