type optimization