bindgen became my friend + refactoring