refactor assign char value