Simplify some lambdas.

Remove a little nesting to simplify some lambdas. Removes an unused definition
(f = ...) of a named function.