remove unnecessary messages parameter in the ToMessages method