Optimized the MessageCracker class (cherry-picked a commit from #125)