This type sniffing is kinda gross. Does it mirror (in principle, at least) how it's done in the libraries?