Yep, I'll refactor that and add it to this patch.