Simplifications and code review
Merge pull request #1 from nickie/master

Simplifications and code review