code refactoring for enhancement
Merge pull request #83 from irvs/issue71

code refactoring for enhancement