remove some unncessary casts