adding truncate() and slugify() utility methods