convert msg into somewhat more parsable format. TODO, convert further to hash?