Optimize all blocks