partial revert of 0f67eb74491e083b93bc7f3e3de4a3de4b9ca661