some code improvements
Merge pull request #3 from pagenoare/master

code improvement