slight restyling and ready for json msgs