Refactor
fix encode issue