Remove unnecessary anonymous function