optimize text and support cleanData. Fixes #500.