combine some identical code
fix typo
use utf