refactor
fix some bugs
fix some bugs
fix typo and change coding style