Refactor to remove stdint.h requirement