Update: one nice little hack, let's see if I can refactor it down with sed