Slightly cleaner message parsing code.