move coercion out of loop