Replace use of stages with before/require