cleaned up the text splitting