Move Statements to Callers

Removes smells
Symptom

A function whose body mixes its core responsibility with statements that genuinely vary per caller — different logging contexts, different post-processing, different metric labels.

Goal

Statements that vary by caller move out of the function so each caller chooses its own setup or follow-up.

Before the refactoring

function emit(line) {
log.write(line);
metrics.tick();
}

After the refactoring

function emit(line) { log.write(line); }
emit('startup');
metrics.tick();
Example source: Illustrative example written for this site, not a quotation from any source.
Pressure

The function's single responsibility is obscured by per-caller variations baked in; adding a new caller forces extending the function's branches.

Tradeoff

If most callers want the moved statements, the change creates duplication — the inverse of Move Statements into Function is only an improvement when callers genuinely differ.

Relief

The function's body becomes about its single responsibility; callers express their differences directly.

Trap

Pushing statements to callers when most callers want them anyway — creates duplication at every call site while the original function was perfectly clear.