Minor cleanup
Code cleanup (less nesting)
Merge pull request #28 from otland/master

clean up