demo version of message handler
refactored example to make it more precise
add gpl v3 license