partial revert 5f6647b

until new implementation is found