Added ffi utility function