Use less invasive scopes in examples

Update the examples to use more minimal scopes so people don't use scopes they don't need.