Optimizing Processes by Minimizing Impurities