I see a lot of these structs throughout the module. I think they should all be moved to a header file, as well as the #defines.