move all supporting methods of the optimization state to OptimizationTools.java