Refactor: move the extern block out of lib.rs
Cleanup warnings