jinwen refactor code