Refactored to enhance readability.
Merge pull request #3 from haoxun/master

Refactored to enhance readability.