Oem ami round2

This cherry picked alex commit onto the current master.