Refactor and reorganize message splitting