Revert "trying to backport some goodies"

This reverts commit d9cf63ee283bdf7ab410ddf23db60ff01968a2c6.