Remove unnecessary anonymous functions.