slowly converting xsb to use new types