Optimize parseMessage and updateSeen