Optimize _.reduce