Add helper function for ffi
Merged