use switch to parse messages