partial regression function refactaring