(I'll add some tests for this in follow-up.)