refactor generated .so lib to use official headers
refactor internals to use official headers