wouldn't it be simpler just to call fit several times?
That would remove a lot of the duplicate code, and it's what I usually do.