Minor refactoring of formatting AST for printing.