Refactor some terms i.e. discrepancy, error for backpropagation.