Yes, a custom output style would be a more idiomatic (and likely more effective) way to implement this.