How to optimize manufacturing