charset refactor