Separate message parsing into own module