[z1969] Partially port [9704]

(based on commit 35ef7fe)

(cleaned version of 14d09c6)

(based on commit [s1558] - aaebf67)