Adding logging, importing, ffi separation