Cleaning up text snippets