Add smarter truncate method