Use closures for local variables.