It looks like this separate function isn't needed at all.  You can just put it all in CastSpell