Reviewers: note that this is both a style change and also introduces a `contextStack` variable.