are all these type casts really necessary?