Do some magic to get rid of some unnecessary casting. (Generic methods, yo)