restructuring messages to be command based
Fix for
https://gist.github.com/glamp/6330090