Refactor some codes
Merge branch 'refactor'