Remove all the unnecessary casting