Revert "revert type extractor stuff"

This reverts commit 6f85fa0165ac745fc986d720135f1bc64d0de9bc.