partial revert of e1e4c7057