rebase of v1.65-code-cleanup into v1.65-code-cleanup-new