Refactoring the formatter a bit.