Merge pull request #4 from xtao/refactor

Refactor app
Fix refactor.