wrap all scopes in lambdas