Code we'll reuse for the target's toplevel.