Unify similar codes to setting extra fields of a history.