Extrac IndentCalculator.

Avoid duplicate code.