Polynomial fit demo: refactoring

16 jobs for fix_polynomial_fit in 18 minutes and 38 seconds (queued for 4 seconds)