type factory improvements