Extract line of best fit calculator to a service.
Make use of existing function for adding dummy data row.
Refactor code for clarity.