remove useless checks and simplify some code
more useless checks
Merge pull request #117 from tamird/patch-1

minor cleanup