partial revert of 896fe11c3e7abf9543cdf2e44d6c89cf25db8018