$nested replacement