Cleanup: move variable assignment that happens in every branch.