Redesigning the way variables are set and isolating the mathematica code.