Clean up some client code and inject less stuff into the scope.