Improve the optimization part of the code to avoid creating files and folders and perform the calculation on the fly.
This should be possible by creating another reaction manager class which takes the template and the current values from the optimizer.