more ub function casting removal