Refactored to easy ffi