move coef calculations to their own service with tests