Rewrote CleanupTextTransformer for better readability

Please merge this :)