Let processMessage take custom message classes.