Use casting instead of a macro