Refacoring of characteristic calculator.