refactored based on code review and fixed incorrect merge
Merge pull request #36 from Thywin/Improvement-CodeReviewComments

Improvement code review comments