Remove unnecessary anonymous functions