Refactor, extract method handle_received_message
Statically allocate user function arg, and check bounds
Add license comments
Add security overview with source links