refactor and bug fix
Merge pull request #25 from xduo/staging

refactor and bug fix