Optimization: removing some closures