attempt to generalize the fitting procedures, but it breaks one of the
gui items