optimise option

Easy one this I hope .
could we have an option when optimising the project to delete all turned off layers .
It would save an awful lot of time cleaning up panel layers manually .