code refactor
Merge pull request #213 from benitoro/master

code refactor