I mean, this looks similar to where the list of options gets reconstructed in $render(), so it _may_ be possible to make use of the existing code.

But then again, it might not :p