start on message parsing and some format tidying