Refactory EventSourceUtil, seperate dumpMessage and dumpSnapshot