Refactor to make the code more consistent and clean.
Merge pull request #1 from snowzjx/branch_refactor

Refactor to make the code more consistent and clean.