refactor linear_coefficients