They are extracted from much more specialized code in builder, and partially rewritten. It will be nice if we can reuse them in the builder, but this is a separate piece of work, that I'm not ready to take right now. 