Refactoring and debugging indent filter