simplify ext/ffi switching logic