Extract "inherit node" function