Optimize tasks