Change fitting class structure to be more modular

extensible.