improved ffi bindings