moved node specific logic into the afterPrep handler