Make toPrettyString a little prettier and more flexible