Partial revert of 91d11f3c60170b610fa24c171a93290fc6fd20a8