Partial revert of 5772c883981369f362631b37800e326a35e2333f