type safe improvement