remove unneccessary casts