[refactor] refactor and fix bugs
Merge branch 'refactor' into dev
Merge branch 'dev'