Merge branch 'ml/encode-header-refactor'