Cleaning up text handling