Refactor delete endStage in all stages