Move message parsing to a set of methods