Rename truncate to trim. Cleanup code.