refactor resonator class into generic fitter