partial revert of 56fe9861a1e2b34f64d460e737dcd7cfb902ec5b