optimise tasks