typing improvements