Refactor and fix some bug
Merge pull request #351 from liuchuangww/user

Refactor and fix some bug