Tidy library interface via FFI
