Make the OptimizeWeight become a class.
Reduce the dimensions of vectors